package common

import (
	"log/slog"
	"time"
	"trader/config"
)

func Init(jwtC config.JWT) {
	d, err := time.ParseDuration(jwtC.ExpireTime)
	if err != nil {
		slog.Warn("ExpireTime err, set 24 hours ", "error", err.Error())
		d = time.Hour * 24
	}

	JwtSignKey = jwtC.SignKey
	JwtExpire = d
}
